<?php
/**
 * Desc：工具库
 * Author：Fly
 * DateTime：2020/9/12 11:33
 */

namespace FlyToper\PearBackend\libs;

class Utils
{
    //统一设置conf方法，兼容单个或数组配置
    public static function setConf($k, $v, &$conf)
    {
        if (is_array($k)) {
            foreach ($k as $name => $val) {
                $conf[$name] = $val;
            }
        } else if ($v || $v === false) {
            $conf[$k] = $v;
        } else {
            //删除属性
            unset($conf[$k]);
        }
    }

    //异常数据打印
    public static function ePrint(\Exception $e)
    {
        return "{$e->getMessage()} # {$e->getFile()} # {$e->getLine()}";
    }




}